package xtu.www.viewinject;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

import com.annotation.BindView;
import com.annotation.OnClick;

import xtu.www.inject.ViewInject;
import xtu.www.viewinject.common.Common;
import xtu.www.viewinject.mvp.Test2MVP;
import xtu.www.viewinject.net.MMCallback;
import xtu.www.viewinject.net.MMResponse;


public class MainActivity extends AppCompatActivity {
    @BindView(R.id.tv)
    TextView mtv;
    @OnClick(R.id.tv)
    void click(){
        Toast.makeText(this,"xx",Toast.LENGTH_LONG).show();
    }
    @OnClick(R.id.tv_1)
    void click1(){
//        Toast.makeText(this,"xx1",Toast.LENGTH_LONG).show();
        Test2MVP.Model testModelImpl = MvpModelData.getModelImpl(Common.TEST_MVP_MODEL_IMPL, Common.BASE_PACK_NAME);
        testModelImpl.getTest2("xxx", new MMCallback() {

            @Override
            public void onSuccess(MMResponse response) {

            }

            @Override
            public void onError(MMResponse response) {

            }
        });
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
//        mtv = (TextView) findViewById(R.id.tv);
//        mtv.setOnClickListener(new View.OnClickListener() {
//
//            @Override
//            public void onClick(View v) {
//
//            }
//        });
        ViewInject.inject(this);
    }
}
